#! /usr/bin/env python
# -*- coding: utf-8 -*-
import rospy
from std_msgs.msg import String

def callback(msg):
    #output log msg
    rospy.loginfo("I receive msg: %s",msg.data)

# def callback2(msg):
#     rospy.loginfo("I receive msg: %s",msg.data)

if __name__ == "__main__":

    #initialize ROS node
    rospy.init_node("subscriber")

    #create a subscriber, and assign topic name,topic type, callback function, and queue_size
    sub = rospy.Subscriber("topic1", String, callback, queue_size=10)
    # sub2 = rospy.Subscriber("topic2", String, callback2, queue_size=10)

    #Cycle the process
    rospy.spin()